package p0;

/**
 * @author pengjz <br>
 * @version 1.0 <br>
 * @name Leetcode_27 <br>
 * @date 2020/9/11 0:10 <br>
 */
public class Leetcode_27 {
    public int removeElement(int[] nums, int val) {
        int slow = 0;
        for (int fast = 0; fast < nums.length; fast++) {
            if (val != nums[fast]) {
                nums[slow++] = nums[fast];
            }
        }
        return slow;
    }
}
